#include "ObjectFactory.h"

ObjectFactory* ObjectFactory::instance = NULL;

ObjectFactory::ObjectFactory() {

}

ObjectFactory::~ObjectFactory() {
    delete instance;
}

ObjectFactory* ObjectFactory::getInstance() {
    if(instance == NULL) {
        instance = new ObjectFactory();
    }

    return instance;
}

GameObject* ObjectFactory::parseObject(std::string object) {
    if(object == "light") {
        return createLight();
    } else if(object.compare(0, 8, "asteroid") == 0) {
        return createAsteroid();
    }

    return new GameObject(object);
}

Light* ObjectFactory::createLight() {
    return new Light();
}

Asteroid* ObjectFactory::createAsteroid() {
    return new Asteroid(glm::vec3(0, 0, 0));
}
